package ui;

import com.sun.lwuit.*;
import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.list.ListCellRenderer;

/**
 *
 * @author Meera
 */
public class DietListRenderer extends Container implements ListCellRenderer {

    private Label item = new Label("");

    public DietListRenderer() {
        setLayout(new BorderLayout());
        Container cnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
        item.getStyle().setBgTransparency(0);

        cnt.addComponent(item);
        addComponent(BorderLayout.EAST, cnt);
    }

    public Component getListCellRendererComponent(List list, Object value, int index, boolean isSelected) {

        item.setText((String) value);
        return item;
    }

    public Component getListFocusComponent(List list) {
        return item;
    }
}
